//package com.ruyuan.eshop.construction.dao;
//
//import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
//import com.baomidou.mybatisplus.core.toolkit.Wrappers;
//import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
//import com.ruyuan.eshop.common.core.PageResult;
//import com.ruyuan.eshop.common.dao.BaseDAO;
//import com.ruyuan.eshop.construction.converter.BuyerConverter;
//import com.ruyuan.eshop.construction.domain.dto.BuyerInfoDTO;
//import com.ruyuan.eshop.construction.domain.entity.BuyerInfoDO;
//import com.ruyuan.eshop.construction.domain.request.BuyerRequest;
//import com.ruyuan.eshop.construction.domain.request.QueryBuyerListRequest;
//import com.ruyuan.eshop.construction.domain.request.QueryBuyerPageRequest;
//import com.ruyuan.eshop.construction.mapper.BuyerInfoMapper;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.stereotype.Repository;
//
//import javax.annotation.Resource;
//import java.util.List;
//
///**
// * 属性扩展
// *
// * @author zhonghuashishan
// */
//@Repository
//@Slf4j
//public class BuyerInfoDAO extends BaseDAO<BuyerInfoMapper, BuyerInfoDO> {
//
//    @Resource
//    private BuyerConverter buyerConverter;
//
//    /**
//     * 新增或者修改规格键信息
//     * @param attributeRequest
//     * @return
//     */
//    public Boolean saveOrUpdate(BuyerRequest attributeRequest) {
//        BuyerInfoDO buyerInfoDO = buyerConverter.converterDO(attributeRequest);
//        buyerInfoDO.initCommon();
//
//        return this.saveOrUpdate(buyerInfoDO);
//    }
//
//    /***
//     *
//     * @param queryBuyerListRequest
//     * @return
//     */
//    public List<BuyerInfoDTO> listBuyerInfo(QueryBuyerListRequest queryBuyerListRequest) {
//        LambdaQueryWrapper<BuyerInfoDO> queryWrapper = Wrappers.lambdaQuery();
//        queryWrapper.in(BuyerInfoDO::getCategoryId, queryBuyerListRequest.getCategoryIdSet());
//        return buyerConverter.converterDTOList(this.list(queryWrapper));
//    }
//
//    public PageResult<BuyerInfoDTO> pageResult(QueryBuyerPageRequest queryBuyerPageRequest) {
//
//        LambdaQueryWrapper<BuyerInfoDO> queryWrapper = Wrappers.lambdaQuery();
//        queryWrapper.like(BuyerInfoDO::getRoster, queryBuyerPageRequest.getRosterLike());
//        Page<BuyerInfoDO> page = new Page<>(queryBuyerPageRequest.getPageNum(), queryBuyerPageRequest.getPageSize());
//        Page<BuyerInfoDO> buyerInfoPage = this.page(page, queryWrapper);
//
//        return buyerConverter.converterPageResult(buyerInfoPage);
//    }
//}
